package com.lagou.edu.utils;

import com.lagou.edu.ProtocolEnum;
import com.lagou.edu.connector.Endpoint;
import com.lagou.edu.connector.protocol.Connector;


/**
 * 连接器工厂，根据协议创建不同的连接器
 *
 * @author liangzj
 * @date 2021/4/7 23:13
 */
public class ConnectorFactory {

    public static Endpoint getConnector(String protocol) {
        if (ProtocolEnum.HTTP11.getProtocol().equalsIgnoreCase(protocol)) {
            return new Connector();
        }
        throw new IllegalArgumentException("unsupported protocol");
    }

}
